]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
overviewControls: only show chat icon in messages indicator for chats
authorCosimo Cecchi <cosimoc@gnome.org>
Mon, 4 Mar 2013 21:23:45 +0000 (16:23 -0500)
committerCosimo Cecchi <cosimoc@gnome.org>
Mon, 4 Mar 2013 21:25:50 +0000 (16:25 -0500)
Only show the chat icon in the new messages indicator when at least one
among the outstanding notifications is a chat.

js/ui/overviewControls.js

index 0906885ac5867ba722c00c18794a87845f4c6347..ba5c7a8f51ff312fd1a990b8985597862313594e 100644 (file)
@@ -452,9 +452,11 @@ const MessagesIndicator = new Lang.Class({
 
     _updateCount: function() {
         let count = 0;
+        let hasChats = false;
         this._sources.forEach(Lang.bind(this,
             function(source) {
                 count += source.indicatorCount;
+                hasChats |= source.isChat;
             }));
 
         this._count = count;
@@ -462,6 +464,7 @@ const MessagesIndicator = new Lang.Class({
                                     "%d new messages",
                                    count).format(count);
 
+        this._icon.visible = hasChats;
         this._updateVisibility();
     },